package com.xrit.service.Impl;

import com.xrit.dao.EmpDao;
import com.xrit.pojo.Departments;
import com.xrit.pojo.Employess;
import com.xrit.service.EmpService;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@MapperScan("com.xrit.dao")
public class EmpServiceImpl implements EmpService {

    @Autowired
    private EmpDao empDao;

    public List findAll() {
        return empDao.findAll();
    }

    public List<Departments> findAllDept() {
        return empDao.findAllDept();
    }

    public Integer insert(Employess employess) {
        empDao.insert(employess);
        System.out.println(employess.getEmpId()+"empid");
        return employess.getEmpId();
    }

    public void delete(Integer empId) {
        empDao.delete(empId);
    }

    public void update(Employess employess) {
        empDao.update(employess);
    }
}
